/**
 *
 * 加密数字签名用的MD5
 *
 * */
import md5 from 'js-md5';
const SECRLIST = [
    "c7ddc993-5948-482b-914b-369667267b88",
    "b51eb618-19b2-41a3-a758-f36cffe94623",
    "a66f9bf2-02b5-4a0f-95d3-eb52b993bb0c",
    "1df7ddb3-cc3d-47eb-b357-210c1ebad43f",
    "f0bffe0a-72b8-4465-bf27-bcf06873a8b7",
    "520c501a-e90c-4692-becf-b91b33fb8086",
    "0efb441e-c0b2-46d2-bc96-44c4724cfbb9",
    "19f0b30f-4fe2-4888-84cf-b5a4f6374936",
    "5191254d-a925-41f1-9ccc-70b8b33057ee",
    "1834f8c1-db70-42c6-a205-d1223f3374ae",
    "b2e70964-6047-463d-b598-606553a54fb3",
    "a1a6faf4-4d7f-4075-8c05-31089192bc99",
    "8c62e7bc-fbca-4dbb-9971-3e97a7e0e98f",
    "a62ebbf8-52f0-4704-8930-f41edd8b5828",
    "dbc19835-a14c-484e-aee0-84cbfe1678a0",
    "6252496b-755c-44ae-9d6d-733ca858e1a5",
    "02a70ce4-0f4b-4032-ae49-9b241d2184bf",
    "c9544e32-caef-41c7-b939-2584a536e349",
    "d69d9a79-b159-4272-b879-213cc344045b",
    "330bc8d0-524e-48fd-b0c7-7a2fab262ced",
    "750bd907-4469-44c3-ae62-5da7b62653ae",
    "64dcf2b9-e08c-4842-af14-959d76a0ea28",
    "4d98b7d9-93fc-472a-9bfb-aeacb9e161b7",
    "20a68267-0129-40af-8660-5b08af633c39",
    "442e9540-8bab-47ff-bea4-635ece5f243c",
    "0abc292f-1f4c-43c0-86d9-e38d0a07f78e",
    "b5328644-7237-475f-99fa-0e54fb2c5dc4",
    "36e57923-bffb-4c78-a71f-0549b8b2a8cd",
    "163d84cb-399c-48fa-b5dc-17a0043bab05",
    "5701b024-bb42-4baf-80cc-844138f874db",
    "5cd10da2-bb15-4670-86bf-3706f04cea68",
    "c833a4c8-5611-4f15-9f10-1471fcdf2625",
    "6d6cb028-417a-4382-9efe-af0465670e70",
    "defdf10e-ff8f-4cdb-a349-e9d8949dd972",
    "6a33a9dc-cc52-4193-a15c-d1fbcfb4a68b",
    "ce8dff52-1eae-466f-a60b-4e5ff850bc73",
    "99c8f1a3-75df-43b7-9e25-488805d08e39",
    "81879d3d-14c7-4b6b-a44a-03c125e8f205",
    "1508fb81-7bc3-4488-8096-ed4fb4806b0e",
    "e73c6210-96dc-4562-9d8c-552005b03d65",
    "aee4dbad-fb68-4152-a617-0cb7bd85e397",
    "366c0cdc-3964-4bce-b96a-1bd0c4578539",
    "c427e2ac-d188-4b0a-9e1a-3ac486e0571d",
    "b6a9e687-9847-494b-9faf-f4576189e802",
    "a693f121-239b-49b9-8e97-8f9a728c6e33",
    "8529dada-a419-4170-a35a-e2da4937d408",
    "7bd64697-671c-4097-a44b-0e47f69e348b",
    "29b07d26-b13a-4ce0-9102-0630101e26d2",
    "799cc42d-ff2a-40cf-bf56-98d06704c10c",
    "48e621c5-a544-4b1a-995b-bee5f345feb3",
    "6e739079-8c61-460e-b762-835a6a97a327",
    "091c6e2b-0eff-4644-a840-ac55aa945395",
    "48101b8c-1496-481e-9e90-f83f6dc2bc38",
    "3d0b286b-e8ca-43dd-8a28-4c61b8690afc",
    "706f8bcc-f7ad-4ea4-9b91-a21a8a55e2d6",
    "42e1c0b7-e441-48b0-96d5-a3e569a7fa90",
    "13133ce0-f6bd-4e9a-9bf3-cd009dd80363",
    "25984302-beeb-423b-9baf-00db2c1c97bb",
    "e31a0ce3-2311-4ed7-bbb6-2c2f3f07d793",
    "30677587-27e8-4ee2-8a3c-563fa28b03f7",
    "4eb7c043-baee-443e-bc91-fab7187169bb",
    "d71040ff-fac2-4d99-b778-75518ae9213e",
    "20f17393-657e-49e2-a21c-636a6c1d96d3",
    "aef6367a-853a-4b1b-8856-50a83557295b",
    "af604168-8a2a-482d-a0f1-59bc0b47621f",
    "12e7ecc1-ef4d-4f26-8454-48dd2954abdd",
    "66e123bf-611a-46d1-b274-d36806b59fac",
    "3e4fca33-fce9-4265-b90b-fa1384e583d2",
    "f31fc79e-92ac-4def-bc41-6c6129297b68",
    "73ddfe6d-a107-412b-bd69-73d8c01f1f7e",
    "b7cede80-edd8-4464-9d58-08ebb837ec2d",
    "d0b2cf48-2225-49b5-87af-f53572ed006a",
    "5bb0d594-38e0-4dde-82db-f4896ba6b4e4",
    "9909b360-53e2-4828-a08f-a31a181fe270",
    "4e4e18f1-9d71-457f-b760-765c2e680c32",
    "dd880606-50e6-4a66-a473-37d7846db37f",
    "bb6b629d-dd90-45d0-8974-8b38e85e96e6",
    "997e411a-0aec-4a44-92fd-584aa3144901",
    "f98b0210-380a-47e9-9dff-63521bf274e1",
    "55fd77dd-4044-495f-b481-0486220a3b87",
    "3b6ac7ba-b63c-496d-a4dc-d6e6d7b6474b",
    "44f47f25-59a6-4a9c-af86-d3aa28307c44",
    "e96d7783-44d2-4237-a7d7-d74e61fba056",
    "65c1749c-253d-4899-b12f-814d33b2de9a",
    "cf4872e5-1df3-47d1-967b-031ea091479d",
    "128bfe47-b517-49b7-bd43-e0bb55070c7e",
    "76e8aa04-9e16-428f-b813-33b8ef899152",
    "695794f1-a7bb-4352-84fb-45243f2dd23e",
    "da94d469-6fc9-47e8-bddf-94168c69d707",
    "df5957c6-bb07-4589-b6b0-d6f8c717c9e3",
    "09d492a1-0cc8-416d-88e6-e6e85cd632fc",
    "7ee7de1a-deb9-4009-b5d2-e869a36549fe",
    "f5af248a-9eb1-4a07-8cd6-61b99ab5bc0a",
    "e3273a0b-9448-4b1e-a16b-4384bef326d0",
    "6784988e-ec6d-44ff-b143-e3e6db2f6b88",
    "335aa7f4-583b-4068-ab43-66966d119881",
    "848723b8-8ba4-4808-9779-b59864c3cdd3",
    "8c679425-4a4d-4da9-848e-69c150e78a54",
    "95808592-390e-44bc-8f0d-8b49b4e99265",
    "384eff20-4b30-4d48-bd1d-9b93a16e8e6"
]


export function getMD5(paramsJson) {//传json对象
    let arr = [];
    for (let key in paramsJson) {
        if (paramsJson[key]) {
            arr.push(key);
        }
    }
    arr.sort();
    let srcStr = "";
    for (let i = 0; i <= arr.length; i++) {
        if (arr[i]) {
            srcStr += arr[i] + paramsJson[arr[i]];
        }
    }

    const stampStr = new Date().getTime() + ''
    const secr = SECRLIST[stampStr.substring(stampStr.length, stampStr.length - 2)]
    const md5Str = md5(srcStr + secr)

    return md5Str + stampStr
}
